package cn.com.chec.en.util;

import java.util.List;
import org.apache.commons.lang.StringUtils;

public class UserRight {
	public static boolean hasRight(String funtionId, List<String> rights) {
		boolean hasRight = false;
		for (String r : rights) {
			if (StringUtils.equals(funtionId, r)) {
				hasRight = true;
				break;
			}
		}
		return hasRight;
	}

	public static boolean isCanOprNews(List<String> rights, String oprFlag) {
		boolean flag = false;
		for (String s : rights) {
			if (s.matches("30\\d{1}" + oprFlag)) {
				flag = true;
				break;
			}
		}
		return flag;
	}

	public static boolean isCanOprBusiness(List<String> rights, String oprFlag) {
		boolean flag = false;
		for (String s : rights) {
			if (s.matches("60\\d{1}" + oprFlag)) {
				flag = true;
				break;
			}
		}
		return flag;
	}
}